package com.hans.scala.actor

import scala.actors.Actor

/**
 *
 * Created by Hans on 2014/4/9.
 */
object SeriousActor extends Actor {
  def act() {
    for (i <- 1 to 5) {
      println("to be or not to be.")
      Thread.sleep(1000)
    }
  }

  def main(args: Array[String]) {
    import Actor._
    val seriousActor2 = actor {
      for (i <- 1 to 5) {
        println("That is the question.")
        Thread.sleep(1000)
      }
    }
    SeriousActor.start()
    SillyActor.start()
  }
}
